package com.dalston.controller;

import com.dalston.Service.UserFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class BookSale {
    @Autowired
    RestTemplate restTemplate;

    @Autowired
    UserFeignClient userFeignClient;

    @GetMapping("/consumer")
    public String user() {
        return restTemplate.getForObject("http://user-service/user",String.class);
    }

    @GetMapping("/feignConsumer")
    public String feignConsumer() {
        return userFeignClient.userFeignConsumer();
    }
}
